package com.ly.demo.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@Service
public class TeacherServiceImpl {
    @Transactional(propagation = Propagation.NESTED)
    public void teacher() {
        String name = "王子";
        log.info("teacher 教书");
        log.info("{}正在教Java",name);

    }
//    @Transactional(rollbackFor = Exception.class,timeout = 10,isolation = Isolation.READ_COMMITTED,propagation = Propagation.REQUIRED,readOnly = false,rollbackForClassName = "java.lang.Exception"
//    @Transactional(rollbackFor = Exception.class,timeout = 10,isolation = Isolation.READ_COMMITTED,propagation = Propagation.REQUIRED,readOnly = false,rollbackForClassName = "java.lang.Exception"
//    @Transactional(rollbackFor = Exception.class,timeout = 10,isolation = Isolation.READ_COMMITTED,propagation = Propagation.REQUIRED,readOnly = false,rollbackForClassName = "java.lang.Exception"
}

